<?php
include_once '../framework/BasePage.page.php';

class CodeBehind extends BasePage {
    
    public function Page_Load(){
        
    }
    
    public function generatePage()
    {
        $pageName = ucfirst($this->txtPageName->val);
        if($pageName!="")
        {
            $fp = fopen("../generated/genCodeBehind/".$pageName.".page.php","w");
            $content = "<?php
include_once '../Framework/BasePage.page.php';
            
/*******
This File is generated
********/
            
class $pageName extends BasePage {

    public function Page_Load()
    {
            
    }
            
}";
            fwrite($fp, $content);
            fclose($fp);
            $this->message->html = "File generated";
        }
        else{
            $this->message->html = "Page name is required.";
        }
    }
}

?>
